Micron Document
<!DOCTYPE html>
<html class="client-nojs vector-feature-night-mode-disabled vector-feature-language-in-header-enabled vector-feature-language-in-main-page-header-disabled vector-feature-page-tools-pinned-disabled vector-feature-toc-pinned-clientpref-1 vector-feature-main-menu-pinned-disabled vector-feature-limited-width-clientpref-1 vector-feature-limited-width-content-enabled vector-feature-custom-font-size-clientpref-1 vector-feature-appearance-pinned-clientpref-1 vector-sticky-header-enabled" lang="en" dir="ltr"><head>
<meta charset="UTF-8">
<title>Rewrite (programming)</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="canonical" href="https://en.wikipedia.org/wiki/Rewrite_(programming)"> <link href="./mw/ext.cite.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.icons.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.search.codex.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/skins.vector.styles.css" rel="stylesheet" type="text/css">
<link href="./mw/user.styles.css" rel="stylesheet" type="text/css">
<meta name="ResourceLoaderDynamicStyles" content="">
<link rel="stylesheet" type="text/css" href="./mw/site.styles.css">
<link rel="stylesheet" type="text/css" href="./mw/noscript.css">
<link rel="stylesheet" type="text/css" href="./footer.css">
<link rel="stylesheet" type="text/css" href="./vector-2022.css">
</head>
<body class="skin--responsive skin-vector skin-vector-search-vue mediawiki ltr sitedir-ltr mw-hide-empty-elt ns-0 ns-subject page-Rewrite_programming rootpage-Rewrite_programming skin-vector-2022 action-view">
<div class="mw-page-container">
<div class="mw-page-container-inner">
<div class="mw-content-container">
<main id="content" class="mw-body">
<header class="mw-body-header vector-page-titlebar">
<h1 id="firstHeading" class="firstHeading mw-first-heading">
<span id="openzim-page-title" class="mw-page-title-main"><span class="mw-page-title-main">Rewrite (programming)</span></span>
</h1>
</header>
<a id="top"></a>
<div id="bodyContent" class="vector-body ve-init-mw-desktopArticleTarget-targetContainer" aria-labelledby="firstHeading" data-mw-ve-target-container="">
<div id="mw-content-text" class="mw-body-content mw-content-ltr" lang="en" dir="ltr"><div class="mw-content-ltr mw-parser-output" lang="en" dir="ltr">
<style data-mw-deduplicate="TemplateStyles:r1236090951">
/* start https://en.wikipedia.org/ */


.mw-parser-output .hatnote{font-style:italic}.mw-parser-output div.hatnote{padding-left:1.6em;margin-bottom:0.5em}.mw-parser-output .hatnote i{font-style:normal}.mw-parser-output .hatnote+link+.hatnote{margin-top:-0.5em}@media print{body.ns-0 .mw-parser-output .hatnote{display:none!important}}


/* end https://en.wikipedia.org/ */
</style><div role="note" class="hatnote navigation-not-searchable">This article is about code rewrites, where it is expected that the behavior will change and is not to be confused with <a href="Code_refactoring" title="Code refactoring">Code refactoring</a>.</div>
<p>A <b>rewrite</b> in <a href="Computer_programming" title="Computer programming">computer programming</a> is the act or result of re-implementing a large portion of existing functionality without re-use of its <a href="Source_code" title="Source code">source code</a>. When the rewrite uses no existing code at all, it is common to speak of a <b>rewrite from scratch</b>.
</p>
<meta property="mw:PageProp/toc">
<div class="mw-heading mw-heading2"><h2 id="Motivations">Motivations</h2></div>
<p>A piece of software is typically rewritten when one or more of the following apply:
</p>
<ul><li>its <a href="Orphaned_work" class="mw-redirect" title="Orphaned work">source code is not available</a> or is only available under an <a href="License_compatibility" title="License compatibility">incompatible</a> <a href="License" title="License">license</a></li>
<li>its code cannot be adapted to a new target platform</li>
<li>its existing code has become too difficult to handle and extend</li>
<li>the task of <a href="Debugging" title="Debugging">debugging</a> it seems too complicated</li>
<li>the programmer finds it difficult to understand its source code</li>
<li>developers learn new techniques or wish to do a big feature overhaul which requires much change</li>
<li>the <a href="Programming_language" title="Programming language">programming language</a> of the source code has to be changed</li></ul>
<div class="mw-heading mw-heading2"><h2 id="Risks">Risks</h2></div>
<p>Several software engineers, such as <a href="Joel_Spolsky" title="Joel Spolsky">Joel Spolsky</a><sup id="cite_ref-:0_1-0" class="reference"><a href="#cite_note-:0-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> have warned against total rewrites, especially under schedule constraints or competitive pressures. While developers may initially welcome the chance to correct historical design mistakes, a rewrite also discards those parts of the design that work as required. A rewrite commits the development team to deliver not just new features, but all those that exist in the previous code, while potentially introducing new bugs or <a href="Software_regression" title="Software regression">regressions</a> of previously fixed bugs.<sup id="cite_ref-2" class="reference"><a href="#cite_note-2"><span class="cite-bracket">[</span>2<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-:0_1-1" class="reference"><a href="#cite_note-:0-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup> A rewrite also interferes with the tracking of unfixed bugs in the old version.<sup id="cite_ref-3" class="reference"><a href="#cite_note-3"><span class="cite-bracket">[</span>3<span class="cite-bracket">]</span></a></sup>
</p><p>The incremental rewrite is an alternative approach, in which developers gradually replace the existing code with calls into a new implementation, expanding that implementation until it fully replaces the old one. This approach avoids a broad loss of functionality during the rewrite. <a href="Cleanroom_software_engineering" title="Cleanroom software engineering">Cleanroom software engineering</a> is another approach, which requires the team to work from an exhaustive written specification of the software's functionality, without access to its code.<sup id="cite_ref-4" class="reference"><a href="#cite_note-4"><span class="cite-bracket">[</span>4<span class="cite-bracket">]</span></a></sup>
</p>
<div class="mw-heading mw-heading2"><h2 id="Examples">Examples</h2></div>
<p><a href="Netscape" title="Netscape">Netscape</a>'s project to improve HTML layout in <a href="Netscape_Navigator" title="Netscape Navigator">Navigator</a> 4 has been cited as an example of a failed rewrite. The new layout engine (<a href="Gecko_(layout_engine)" class="mw-redirect" title="Gecko (layout engine)">Gecko</a>) had developed independently of Navigator and did not integrate readily with Navigator's code; hence, Navigator itself was rewritten around the new engine, breaking many existing features and delaying release by several months. Meanwhile, <a href="Microsoft" title="Microsoft">Microsoft</a> focused on incremental improvements to <a href="Internet_Explorer" title="Internet Explorer">Internet Explorer</a> and did not face the same obstacles.<sup id="cite_ref-:0_1-2" class="reference"><a href="#cite_note-:0-1"><span class="cite-bracket">[</span>1<span class="cite-bracket">]</span></a></sup><sup id="cite_ref-5" class="reference"><a href="#cite_note-5"><span class="cite-bracket">[</span>5<span class="cite-bracket">]</span></a></sup> Ironically, Navigator itself was a successful cleanroom rewrite of <a href="NCSA_Mosaic" title="NCSA Mosaic">NCSA Mosaic</a> overseen by that program's developers. See <a href="Browser_wars" title="Browser wars">Browser wars</a>.
</p><p>Some projects mentioning major rewrites in their history:
</p>
<style data-mw-deduplicate="TemplateStyles:r1184024115">
/* start https://en.wikipedia.org/ */


.mw-parser-output .div-col{margin-top:0.3em;column-width:30em}.mw-parser-output .div-col-small{font-size:90%}.mw-parser-output .div-col-rules{column-rule:1px solid #aaa}.mw-parser-output .div-col dl,.mw-parser-output .div-col ol,.mw-parser-output .div-col ul{margin-top:0}.mw-parser-output .div-col li,.mw-parser-output .div-col dd{page-break-inside:avoid;break-inside:avoid-column}


/* end https://en.wikipedia.org/ */
</style><div class="div-col">
<ul><li><a href="Apache_HTTP_Server" title="Apache HTTP Server">Apache HTTP Server</a> (1)</li>
<li><a href="AOL_Instant_Messenger" class="mw-redirect" title="AOL Instant Messenger">AOL Instant Messenger</a> (1)</li>
<li><a href="BIND" title="BIND">BIND</a> (1)</li>
<li><a href="Freenet" class="mw-redirect" title="Freenet">Freenet</a> (1)</li>
<li><a href="GNU_GRUB" title="GNU GRUB">GRUB</a> (1)</li>
<li><a href="Majordomo_(software)" title="Majordomo (software)">Majordomo</a> (1)</li>
<li><a href="History_of_Wikipedia#Hardware_and_software" title="History of Wikipedia">MediaWiki</a> (1)</li>
<li><a href="History_of_Mozilla_Application_Suite" title="History of Mozilla Application Suite">Mozilla/Netscape</a> (1)</li>
<li><a href="Icecast" title="Icecast">Icecast</a> (0–1)</li>
<li><a href="Netcat" title="Netcat">netcat</a> (1)</li>
<li>OpenRPG (1)</li>
<li><a href="PHP" title="PHP">PHP</a> (1–2)</li>
<li><a href="Project_Xanadu" title="Project Xanadu">Project Xanadu</a> (0–1)</li>
<li><a href="Sun_Secure_Global_Desktop" class="mw-redirect" title="Sun Secure Global Desktop">Sun Secure Global Desktop</a> (1)</li>
<li><a href="VBulletin" title="VBulletin">vBulletin</a> (2)</li>
<li><a href="WebObjects" title="WebObjects">WebObjects</a> (1)</li>
<li><a href="Zope" title="Zope">Zope</a> (1)</li></ul>
</div>
<div class="mw-heading mw-heading2"><h2 id="Techniques">Techniques</h2></div>
<ul><li><a href="Strangler_fig_pattern" title="Strangler fig pattern">Strangler fig pattern</a></li></ul>
<div class="mw-heading mw-heading2"><h2 id="See_also">See also</h2></div>
<ul><li><a href="Code_refactoring" title="Code refactoring">Code refactoring</a></li>
<li><a href="Open_source_software_development" class="mw-redirect" title="Open source software development">Open source software development</a></li>
<li><a href="Technical_debt" title="Technical debt">Technical debt</a></li>
<li><a href="Development_hell" title="Development hell">Development hell</a></li>
<li><a href="Porting" title="Porting">Porting</a></li>
<li><a href="Game_engine_recreation" title="Game engine recreation">Game engine recreation</a></li>
<li><a href="Reverse_engineering" title="Reverse engineering">Reverse engineering</a></li></ul>
<div class="mw-heading mw-heading2"><h2 id="References">References</h2></div>
<style data-mw-deduplicate="TemplateStyles:r1239543626">
/* start https://en.wikipedia.org/ */


.mw-parser-output .reflist{margin-bottom:0.5em;list-style-type:decimal}@media screen{.mw-parser-output .reflist{font-size:90%}}.mw-parser-output .reflist .references{font-size:100%;margin-bottom:0;list-style-type:inherit}.mw-parser-output .reflist-columns-2{column-width:30em}.mw-parser-output .reflist-columns-3{column-width:25em}.mw-parser-output .reflist-columns{margin-top:0.3em}.mw-parser-output .reflist-columns ol{margin-top:0}.mw-parser-output .reflist-columns li{page-break-inside:avoid;break-inside:avoid-column}.mw-parser-output .reflist-upper-alpha{list-style-type:upper-alpha}.mw-parser-output .reflist-upper-roman{list-style-type:upper-roman}.mw-parser-output .reflist-lower-alpha{list-style-type:lower-alpha}.mw-parser-output .reflist-lower-greek{list-style-type:lower-greek}.mw-parser-output .reflist-lower-roman{list-style-type:lower-roman}


/* end https://en.wikipedia.org/ */
</style><div class="reflist reflist-columns references-column-width" style="column-width: 30em;">
<ol class="references">
<li id="cite_note-:0-1"><span class="mw-cite-backlink">^ <a href="#cite_ref-:0_1-0"><sup><i><b>a</b></i></sup></a> <a href="#cite_ref-:0_1-1"><sup><i><b>b</b></i></sup></a> <a href="#cite_ref-:0_1-2"><sup><i><b>c</b></i></sup></a></span> <span class="reference-text"><style data-mw-deduplicate="TemplateStyles:r1238218222">
/* start https://en.wikipedia.org/ */


.mw-parser-output cite.citation{font-style:inherit;word-wrap:break-word}.mw-parser-output .citation q{quotes:"\"""\"""'""'"}.mw-parser-output .citation:target{background-color:rgba(0,127,255,0.133)}.mw-parser-output .id-lock-free.id-lock-free a{background:url("./mw/Lock-green.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-limited.id-lock-limited a,.mw-parser-output .id-lock-registration.id-lock-registration a{background:url("./mw/Lock-gray-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .id-lock-subscription.id-lock-subscription a{background:url("./mw/Lock-red-alt-2.svg")right 0.1em center/9px no-repeat}.mw-parser-output .cs1-ws-icon a{background:url("./mw/Wikisource-logo.svg")right 0.1em center/12px no-repeat}body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-free a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-limited a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-registration a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .id-lock-subscription a,body:not(.skin-timeless):not(.skin-minerva) .mw-parser-output .cs1-ws-icon a{background-size:contain;padding:0 1em 0 0}.mw-parser-output .cs1-code{color:inherit;background:inherit;border:none;padding:inherit}.mw-parser-output .cs1-hidden-error{display:none;color:var(--color-error,#d33)}.mw-parser-output .cs1-visible-error{color:var(--color-error,#d33)}.mw-parser-output .cs1-maint{display:none;color:#085;margin-left:0.3em}.mw-parser-output .cs1-kern-left{padding-left:0.2em}.mw-parser-output .cs1-kern-right{padding-right:0.2em}.mw-parser-output .citation .mw-selflink{font-weight:inherit}@media screen{.mw-parser-output .cs1-format{font-size:95%}html.skin-theme-clientpref-night .mw-parser-output .cs1-maint{color:#18911f}}@media screen and (prefers-color-scheme:dark){html.skin-theme-clientpref-os .mw-parser-output .cs1-maint{color:#18911f}}


/* end https://en.wikipedia.org/ */
</style><cite id="CITEREFSpolsky2000" class="citation web cs1">Spolsky, Joel (6 April 2000). <a rel="nofollow" class="external text" href="http://www.joelonsoftware.com/articles/fog0000000069.html">"Things You Should Never Do, Part I"</a>. <i>Joel on Software</i><span class="reference-accessdate">. Retrieved <span class="nowrap">2015-01-23</span></span>.</cite></span>
</li>
<li id="cite_note-2"><span class="mw-cite-backlink"><b><a href="#cite_ref-2">^</a></b></span> <span class="reference-text"><cite id="CITEREFRonkes_Agerbeek2005" class="citation web cs1">Ronkes Agerbeek, Joost (April 15, 2005). <a rel="nofollow" class="external text" href="https://web.archive.org/web/20081010211819/http://www.ronkes.nl/blog/?2005-04-15-neverrewritecode">"Never Rewrite Code From Scratch"</a>. Archived from <a rel="nofollow" class="external text" href="http://www.ronkes.nl/blog/?2005-04-15-neverrewritecode">the original</a> on October 10, 2008<span class="reference-accessdate">. Retrieved <span class="nowrap">2008-09-11</span></span>.</cite></span>
</li>
<li id="cite_note-3"><span class="mw-cite-backlink"><b><a href="#cite_ref-3">^</a></b></span> <span class="reference-text"><cite id="CITEREFZawinski" class="citation web cs1"><a href="Jamie_Zawinski" title="Jamie Zawinski">Zawinski, Jamie</a>. <a rel="nofollow" class="external text" href="https://www.jwz.org/doc/cadt.html">"Cascade of Attention-Deficit Teenagers"</a><span class="reference-accessdate">. Retrieved <span class="nowrap">2008-09-11</span></span>.</cite></span>
</li>
<li id="cite_note-4"><span class="mw-cite-backlink"><b><a href="#cite_ref-4">^</a></b></span> <span class="reference-text"><cite id="CITEREFTilly2001" class="citation web cs1">Tilly, Ben (September 29, 2001). <a rel="nofollow" class="external text" href="http://www.perlmonks.org/?node_id=115511">"Rewriting, from scratch, a huge code base"</a><span class="reference-accessdate">. Retrieved <span class="nowrap">2008-09-11</span></span>.</cite></span>
</li>
<li id="cite_note-5"><span class="mw-cite-backlink"><b><a href="#cite_ref-5">^</a></b></span> <span class="reference-text"><cite id="CITEREFZawinski1999" class="citation web cs1"><a href="Jamie_Zawinski" title="Jamie Zawinski">Zawinski, Jamie</a> (March 31, 1999). <a rel="nofollow" class="external text" href="https://www.jwz.org/gruntle/nomo.html">"resignation and postmortem"</a><span class="reference-accessdate">. Retrieved <span class="nowrap">2008-09-11</span></span>.</cite></span>
</li>
</ol></div>
<div class="mw-heading mw-heading2"><h2 id="External_links">External links</h2></div>
<ul><li><cite id="CITEREFSneedVerhoef2019" class="citation journal cs1">Sneed, Harry; Verhoef, Chris (2019-09-01). <a rel="nofollow" class="external text" href="https://www.sciencedirect.com/science/article/pii/S0164121219301050">"Re-implementing a legacy system"</a>. <i>Journal of Systems and Software</i>. <b>155</b>: <span class="nowrap">162–</span>184. <a href="Doi_(identifier)" class="mw-redirect" title="Doi (identifier)">doi</a>:<a rel="nofollow" class="external text" href="https://doi.org/10.1016%2Fj.jss.2019.05.012">10.1016/j.jss.2019.05.012</a>. <a href="ISSN_(identifier)" class="mw-redirect" title="ISSN (identifier)">ISSN</a>&nbsp;<a rel="nofollow" class="external text" href="https://search.worldcat.org/issn/0164-1212">0164-1212</a>.</cite></li>
<li><a rel="nofollow" class="external text" href="http://www.c2.com/cgi/wiki?RewriteCodeFromScratch">RewriteCodeFromScratch at C2 Wiki</a></li>
<li><a rel="nofollow" class="external text" href="http://www.joelonsoftware.com/articles/fog0000000069.html">Things You Should Never Do, Part I</a> by <a href="Joel_Spolsky" title="Joel Spolsky">Joel Spolsky</a></li></ul></div><!--htdig_noindex--><div><div class="zim-footer">
This article is issued from <a class="external text" title="Last edited on 2025-06-05" href="https://en.wikipedia.org/wiki/?title=Rewrite_(programming)&amp;oldid=1294091238">Wikipedia</a>. The text is available under <a class="external text" href="https://creativecommons.org/licenses/by-sa/4.0/deed.en">Creative Commons Attribution-Share Alike 4.0</a> unless otherwise noted. Additional terms may apply for the media files.
</div>
</div><!--/htdig_noindex--></div>
</div>
</main>
</div>
</div>
</div>

</body></html>